require("../../assets/css/normalize.css");
require("../../assets/css/reset.css");
require("../../assets/fonts/iconfont.css");
require("../../assets/css/tabbar.less");
require("./mine.less");

//引入模块
const dom = require("../../utils/dom.js");
const axios = require("axios");
document.addEventListener("DOMContentLoaded", async function () {
	dom.tabbar("mine");
	let token = localStorage.getItem("token");
	axios.defaults.headers.common["Authorization"] = "Bearer " + token;
	let res = await axios.get("http://fitness.h5.itsource.cn:3701/api/exercise");
	let { sum7Calorie, sum7Duration, sum7Meter, days } = res.data.data;

	dom.get("#cal").textContent = sum7Calorie;
	dom.get("#duration").textContent = sum7Duration;
	dom.get(".btn").addEventListener("click", function () {
		location.href = "login.html";
	});
});
